Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add RegisterAll API to enable monitoring collections of key-values for refresh #574

Open
wants to merge 45 commits into
base: preview
Choose a base branch
from

Conversation

amerjusupovic
Copy link
Member

@amerjusupovic amerjusupovic commented Jul 15, 2024

This PR adds the new RegisterAll API to monitor any key-values added with AzureAppConfigurationOptions.Select for refresh as a collection, but it will also begin monitoring feature flags as a collection instead of on an individual basis. Consequently, feature flag changes will no longer be logged on an individual basis. This solves an existing issue.

{
internal class ConfigurationSettingPageableManager
{
public virtual IAsyncEnumerable<Page<ConfigurationSetting>> GetPages(AsyncPageable<ConfigurationSetting> pageable, IEnumerable<MatchConditions> matchConditions)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are these methods virtual?

Copy link
Member Author

@amerjusupovic amerjusupovic Aug 2, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, I didn't document this anywhere so good callout. The approach recommended by the SDK team for testing the AsPages extension with MatchConditions as seen here was to create a virtual method that we could override in the tests using the MockConfigurationSettingPageableManager class. Because Moq doesn't let you mock extension methods, this was the only approach that we came up with. Any details I missed are probably in the issue I linked in the PR description.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants